table of contents
SNAPPER(8) | Filesystem Snapshot Management | SNAPPER(8) |
NAME¶
snapper - Command-line program for filesystem snapshot management
SYNOPSIS¶
snapper [--global-opts] command [--command-opts] [command-arguments]
snapper {--help}
DESCRIPTION¶
Snapper is a command-line program for filesystem snapshot management. It can create, delete and compare snapshots and undo changes done between snapshots.
Snapper never modifies the content of snapshots. Thus snapper creates read-only snapshots if supported by the kernel. Supported filesystems are btrfs as well as snapshots of LVM logical volumes with thin-provisioning.
CONCEPTS¶
Configurations¶
For each filesystem or subvolume that should be snapshotted by snapper, a configuration file is required, see snapper-configs(5). The setup can be done with the create-config command.
Snapshots¶
Snapper distinguishes three types of snapshots.
pre
post
single
Note that filesystem-wise all three types are the same.
Snapshot Description and Userdata¶
With each snapshot a description and some userdata can be associated. The description is a string. The userdata is a list of key-value pairs where the keys and values are strings.
Automatic Snapshot Creation¶
Next to manual snapshot creation, snapshots are also created automatically.
Cleanup Algorithms¶
Snapper provides several algorithms to clean up old snapshots. The algorithms are executed in a daily cron-job. This can be configured in the corresponding configurations files along with parameters for every algorithm.
number
timeline
empty-pre-post
Filters¶
Some files keep state information of the system, e.g. /etc/mtab. Such files should never be reverted. To help users, snapper allows to ignore these files.
Each line in all files /etc/snapper/filters/*.txt specifies a pattern. When snapper computes the difference between two snapshots it ignores all files and directories matching any of those patterns by using fnmatch(3) with the flag FNM_LEADING_DIR.
Note that filters do not exclude files or directories from being snapshotted. For that, use subvolumes or mount points.
GLOBAL OPTIONS¶
-q, --quiet
-v, --verbose
--utc
--iso
-t, --table-style
-c, --config name
--no-dbus
Use with caution since a running snapperd will not know about modifications made to the system.
-r, --root path
--version
COMMANDS¶
Snapper provides a number of commands. Each command accepts the options listed in the GLOBAL OPTIONS section. These options must be specified before the command name. In addition, many commands have specific options, which are listed in this section. These command-specific options must be specified after the name of the command and before any of the command arguments.
help
list-configs
create-config [options] subvolume
-f, --fstype fstype
Without this option snapper tries to detect the filesystem.
-t, --template name
delete-config
get-config
set-config configdata
list (ls) [options]
-t, --type type
-a, --all-configs
create [options]
-t, --type type
--pre-number number
-p, --print-number
-d, --description description
-c, --cleanup-algorithm cleanup-algorithm
-u, --userdata userdata
--command command
modify [options] number
-d, --description description
-c, --cleanup-algorithm cleanup-algorithm
-u, --userdata userdata
delete (remove|rm) number | number1-number2
-s, --sync
Btrfs normally asynchronously frees space after deleting snapshots. With this option snapper will wait until the space once used by the deleted snapshots is actually available again.
mount number
umount number
status [options] number1..number2
-o, --output file
The output consists of a string encoding the status followed by the filename. The characters of the status string are:
If there is no change a "." is outputted.
diff [options] number1..number2 [files]
-i, --input file
--diff-cmd command
-x, --extensions options
undochange [options] number1..number2 [files]
-i, --input file
rollback [options] [number]
Rollback is only supported with btrfs and requires a properly configured system.
-p, --print-number
-d, --description description
-c, --cleanup-algorithm cleanup-algorithm
-u, --userdata userdata
cleanup cleanup-algorithm
xadiff number1..number2 [files]
PERMISSIONS¶
Non-root users can be allowed to use a configuration by setting ALLOW_USERS or ALLOW_GROUPS in the config file. For all operations to work, the user must also be able to read and access the .snapshots directory inside the subvolume. The .snapshots directory must be owned by root and must not be writable by anybody else.
Here are some methods how to achieve that:
chmod a+rx .snapshots
chown :users .snapshots
setfacl -m u:tux:rx .snapshots
The last method can be performed by snapper, see the SYNC_ACL setting in snapper-configs(5).
FILES¶
/etc/sysconfig/snapper
/etc/snapper/configs
/etc/snapper/config-templates
/etc/snapper/filters/*.txt
/var/log/snapper.log
NOTES¶
There is no mechanism to ensure consistency of the files while a snapshot it made. E.g. the files of a database can be inconsistent while the database is running.
Consistency after undochange is not guaranteed. E.g. when the creation of a user is undone, there might still exist files from that user.
Support for individual filesystems, rollback and extended attributes are compile-time options and may not be available.
HOMEPAGE¶
AUTHORS¶
Arvin Schnell <aschnell@suse.de>
SEE ALSO¶
snapper-configs(5), snapper-zypp-plugin(8), pam_snapper(8), btrfs(8), lvm(8), attr(5), acl(5)
2014-04-07 | 0.2.8 |